Skip to content

Initial commit.#3

Draft
Grzegorz-Smagacz-Mobica wants to merge 21 commits intomainfrom
sparse_image
Draft

Initial commit.#3
Grzegorz-Smagacz-Mobica wants to merge 21 commits intomainfrom
sparse_image

Conversation

@Grzegorz-Smagacz-Mobica
Copy link
Collaborator

Description

Please include a summary of the change, new sample or fixed issue. Please also include relevant motivation and context.
Please read the contribution guidelines

Fixes #

General Checklist:

Please ensure the following points are checked:

  • My code follows the coding style
  • I have reviewed file licenses
  • I have commented any added functions (in line with Doxygen)
  • I have commented any code that could be hard to understand
  • My changes do not add any new compiler warnings
  • My changes do not add any new validation layer errors or warnings
  • I have used existing framework/helper functions where possible
  • My changes do not add any regressions
  • I have tested every sample to ensure everything runs correctly
  • This PR describes the scope and expected impact of the changes I am making

Note: The Samples CI runs a number of checks including:

  • I have updated the header Copyright to reflect the current year (CI build will fail if Copyright is out of date)
  • My changes build on Windows, Linux, macOS and Android. Otherwise I have documented any exceptions

Sample Checklist

If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist:

  • I have tested the sample on at least one compliant Vulkan implementation
  • If the sample is vendor-specific, I have tagged it appropriately
  • I have stated on what implementation the sample has been tested so that others can test on different implementations and platforms
  • Any dependent assets have been merged and published in downstream modules
  • For new samples, I have added a paragraph with a summary to the appropriate chapter in the samples readme
  • For new samples, I have added a tutorial README.md file to guide users through what they need to know to implement code using this feature. For example, see conditional_rendering

Copy link
Collaborator

@Patryk-Jastrzebski-Mobica Patryk-Jastrzebski-Mobica left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not all there is, but enough for the moment

CATEGORY ${CATEGORY_NAME}
AUTHOR "Mobica"
NAME "sparse_image"
DESCRIPTION "Sample description"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add description

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't forget to add sample and feature descriptions and Mobica copyright information

@@ -0,0 +1,18 @@
#version 450
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add Mobica copyright information

@@ -0,0 +1,44 @@
#version 450
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add Mobica copyright information

NAME "sparse_image"
DESCRIPTION "Sample description"
SHADER_FILES_GLSL
"shader.vert"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use full path sparse_image/shader.vert and rename the shader name e.g. to sparse.vert

VK_CHECK(vkCreateGraphicsPipelines(get_device().get_handle(), pipeline_cache, 1, &pipeline_create_info, nullptr, &sample_pipeline));
}

void sparse_image::setup_camera()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

camera should be setup in constructor


void sparse_image::generate_mips()
{
VkCommandBuffer command_buffer = begin_single_time_command();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use device->create_command_buffer();
and end it device->flush_command_buffer();

alignas(16) glm::mat4 proj;
};

struct SimpleBuffer
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This structure is not needed and not using it correctly can cause performance problems. Use vkb::core::Buffer, which uses VMA.

size_t size;
};

struct SimpleVertex
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider using Vertex struct. You can find it in api_vulkan_sample.h


VK_CHECK(vkAllocateDescriptorSets(get_device().get_handle(), &set_alloc_info, &descriptor_set));

VkDescriptorBufferInfo descriptor_buffer_info{};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use this method: create_descriptor()

…odel. Instead, whole mesh is calculated using MVP transformation matrix which makes calculations way more trouble-proof. MINOR: some quick changes, using already written wrappers for some functionalities, and adding some descriptions here and there.
…fragment shader - from now the shader checks if the required fragment is resident in the memory before sampling from it (no explicit calculations required,shader will sample from whatever is ACTUALLY available). On the CPU side, workload was divided into stages, many phases removed/rewritten.
* Fixed run-time errors from validation layers
* Changed .md to .adoc style
…rame is rendered.

* Removed transition_mip_layout() and replaced it with vkb::image_layout_transition().
* Minor bugs and typos.
…ts + allow to toggle color highlighting

* Added additional uniform buffer containing data needed by fragment shader
* Removed call to bind_sparse_image() from free_unused_memory() as it is redundant
* Merged UPDATE_AND_GENERATE and FREE_UNUSED_MEMORY stages
* Removed virtual_texture.free_list as it is redundant
* Replaced virtual_texture.bind_list with to_be_bound flag under the virtual_texture.page_table
* Changed available_memory_index_list from std::list to std::vector
* Minor bugs / code refactoring
* Block update is now better prioritized to update the closest areas first
* Refactoring
* Memory defragmentation can be enabled for the better memory management
* From now number of vertical/horizontal blocks can be changed from the UI
* Number of blocks processed per-frame can be customized from UI too
* Frame-counter mechanism can be enabled/disabled from the UI
* Moved sparse_queue to separate (if possible) queue family, other than graphics queue
* Introduced synchronization between binding the image and submitting the image
* update_and_generate() was reduced to single command_buffer and one-time flush()
* Several minor reworks/fixes for better code styling and efficiency
* Put additional descriptions to README.adoc
* Minor issues, cleanups & typo's
* unified copyrights
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants